<?php
/**
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled with this
 * package in the file LICENSE.txt. It is also available through the
 * world-wide-web at this URL: http://dragonjsonserver.de/license. If you did
 * not receive a copy of the license and are unable to obtain it through the
 * world-wide-web, please send an email to license@dragonjsonserver.de. So we
 * can send you a copy immediately.
 *
 * @copyright Copyright (c) 2012 DragonProjects (http://dragonprojects.de)
 * @license http://framework.zend.com/license/new-bsd New BSD License
 * @author Christoph Herrmann <developer@dragonjsonserver.de>
 */
?>
<div class="hero-unit">
    <p><?php echo $this->escape($this->message); ?></p>
</div>
<?php if (APPLICATION_ENV == 'development') { ?>
<table>
    <tr>
        <th>Exception:</th>
        <td><?php echo $this->escape(get_class($this->exception)); ?></td>
    </tr>
    <tr>
        <th>Message:</th>
        <td><?php echo $this->escape($this->exception->getMessage()); ?></td>
    </tr>
    <tr>
        <th>Code:</th>
        <td><?php echo $this->escape($this->exception->getCode()); ?></td>
    </tr>
    <tr>
        <th>File:</th>
        <td><?php echo $this->escape($this->exception->getFile()); ?></td>
    </tr>
    <tr>
        <th>Line:</th>
        <td><?php echo $this->escape($this->exception->getLine()); ?></td>
    </tr>
    <tr>
        <th>Trace:</th>
        <td>
            <table>
                <?php foreach ($this->exception->getTrace() as $trace) { ?>
                <tr>
                    <th>File:</th>
                    <td><?php echo $this->escape($trace['file']); ?></td>
                </tr>
                <tr>
                    <th>Function:</th>
                    <td><?php echo $this->escape($trace['function']); ?></td>
                </tr>
                <tr>
                    <th>Class:</th>
                    <td><?php echo $this->escape($trace['class']); ?></td>
                </tr>
                <tr>
                    <th>Type:</th>
                    <td><?php echo $this->escape($trace['type']); ?></td>
                </tr>
                <tr>
                    <th>Args:</th>
                    <td>
                        <table>
                            <?php
                            foreach ($trace['args'] as $arg) {
                                $type = gettype($arg);
                            ?>
                            <tr>
                                <th><?php echo $this->escape($type); ?>:</th>
                                <td><?php echo $this->escape($type == 'object' ? get_class($arg) : $arg); ?></td>
                            </tr>
                            <?php } ?>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td colspan="2"><br /></td>
                </tr>
                <?php } ?>
            </table>
        </td>
    </tr>
</table>
<?php } ?>
